﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AbstractFactory
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.ReadKey();
        }
    }

    public interface Shape
    {
        void Draw();
    }

    public class Rectangle : Shape
    {
        public void Draw()
        {
            Console.WriteLine("Inside Rectangle::draw() method.");
        }
    }
    public class Square : Shape
    {
        public void Draw()
        {
            Console.WriteLine("Inside Square::draw() method.");
        }
    }
    public class Circle : Shape
    {
        public void Draw()
        {
            Console.WriteLine("Inside Circle::draw() method.");
        }
    }

    public interface Color
    {
        void fill();
    }

    public class Red : Color
    {
        public void fill()
        {
            Console.WriteLine("Inside Red::fill() method.");
        }
    }
    public class Green : Color
    {
        public void fill()
        {
            Console.WriteLine("Inside Green::fill() method.");
        }
    }
    public class Blue : Color
    {
        public void fill()
        {
            Console.WriteLine("Inside Blue::fill() method.");
        }
    }
    //为 Color 和 Shape 对象创建抽象类来获取工厂
    public abstract class AbstractFactory
    {
        public abstract Shape CreateShape();
        public abstract Color CreateColor();
    }

    //创建扩展了 AbstractFactory 的工厂类，基于给定的信息生成实体类的对象。
    public class ShapeFactory : AbstractFactory
    {
        public override Color CreateColor()
        {
            throw new NotImplementedException();
        }

        public override Shape CreateShape()
        {
            throw new NotImplementedException();
        }
    }
    // 测试GIt commit
}
